package com.smart.lx.strategy;

/**
 * 功能描述: <br>
 * 〈支付策略模式〉
 *
 * @since: 1.0.0
 * @Author:abc
 * @Date: 2019/4/5
 */
public class PayStrategy {

    public void pay(String payWay){

        String className = IPay.class.getPackage().getName() + "." +payWay;
        try{
            IPay pay = (IPay) Class.forName(className).newInstance();
            pay.pay();
        }catch(Exception e){
            throw new RuntimeException("can not found the pay way");
        }
    }


}
